package com.citcc.business.service;

import com.citcc.business.bean.CdzStake;
import com.citcc.business.bean.vo.CdzStakeVo;
import com.citcc.business.mapper.CdzStakeMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class CdzStakeService {

    private final CdzStakeMapper cdzStakeMapper;

    @Autowired
    public CdzStakeService(CdzStakeMapper cdzStakeMapper){
        this.cdzStakeMapper=cdzStakeMapper;
    }

    public List<CdzStake> selectAllList(CdzStake stake){
        return cdzStakeMapper.selectAllList(stake);
    }

    public int add(CdzStake stake){
        return cdzStakeMapper.insertSelective(stake);
    }

    public int update(CdzStake stake){
        return cdzStakeMapper.updateByPrimaryKeySelective(stake);
    }

    public int delete(String id){
        return cdzStakeMapper.deleteByPrimaryKey(id);
    }

    public CdzStake getCdzStake(String id){
        return cdzStakeMapper.selectByPrimaryKey(id);
    }

    public int countStation(String stationId){
        return cdzStakeMapper.countStation(stationId);
    }

    public int countManufacturer(String trademark){
        return cdzStakeMapper.countManufacturer(trademark);
    }

    public List<CdzStakeVo> getStakeListByStationId(String stationId) {
        return cdzStakeMapper.getStakeListByStationId(stationId);
    }
    public List<Map<String,Object>> getGunListByStationId(String stationId) {
        return cdzStakeMapper.getGunListByStationId(stationId);
    }

    public CdzStake getCdzStakeByStakeCode(String code){
        return cdzStakeMapper.getByStakeCode(code);
    }
}
